import book.BookList;
import user.Admin;
import user.Normal;
import user.User;

import java.util.Scanner;

public class Main {

    public static User login(){
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入姓名：");
        String name = scan.nextLine();
        System.out.println("请输入身份: 1.管理员  2.普通用户");
        int n = scan.nextInt();
        if(n==1){
//            Admin admin = new Admin(name);
            return new Admin(name);
        }else{
//            Normal normal = new Normal(name);
            return new Normal(name);

        }

    }

    public static void main(String[] args) {
        BookList bookList=new BookList();

        User user = login();

        while (true) {
            int choice = user.Menu();
            user.doOperation(choice, bookList);
        }

    }
}
